package ch03.d3;

import org.junit.Assert;
import org.junit.Test;

import java.util.Scanner;

public class ToolsTest {
    //测试用例
    @Test
    public void testArea(){
        Tools t = new Tools();
        //断言
        Assert.assertEquals(28.26, t.area(3),0.01);
    }

    @Test
    public void testGetDayOfYear(){
        Tools t = new Tools();
        Assert.assertEquals(1, t.getDayOfYear(2019,1,1));
        Assert.assertEquals(32, t.getDayOfYear(2019,2,1));
        Assert.assertEquals( 72 , t.getDayOfYear(2019,3,13));
        Assert.assertEquals(365, t.getDayOfYear(2019,12,31));
        Assert.assertEquals(366, t.getDayOfYear(2020,12,31));
    }

//    @Test
//    public void testArea2(){
//        Tools t = new Tools();
//        Scanner scan=new Scanner(System.in);
//        System.out.println(t.area(scan.nextInt()));
//    }
}
